//
//  LYQHomeResourceCell.m
//  ZCProject
//
//  Created by Zheng on 16/11/8.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQHomeResourceCell.h"

@implementation LYQHomeResourceCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.showImgv];
        [self.contentView addSubview:self.titleLbl];
        [self.contentView addSubview:self.tagLbl];
        [self.contentView addSubview:self.readNumLbl];
        [self.contentView addSubview:self.typeLbl];
        
        [self layoutSubviewsInContentView];
        
    }
    return self;
}

#pragma mark - layout subviews
- (void)layoutSubviewsInContentView {
    
    [_showImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(kWScale(110)));
        make.height.equalTo(@(kWScale(90)));
        make.left.mas_equalTo(kWScale(10));
        make.centerY.equalTo(self);
    }];
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_showImgv.mas_right).offset(kWScale(15));
        make.top.equalTo(_showImgv).offset(kWScale(5));
    }];
    
    [_readNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLbl);
        make.bottom.equalTo(_showImgv).offset(-kWScale(5));
    }];
    
    [_typeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_readNumLbl.mas_right).offset(kWScale(10));
        make.right.mas_equalTo(-15);
        make.bottom.equalTo(_readNumLbl);
    }];
    
    [_tagLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_readNumLbl);
        make.right.equalTo(_typeLbl);
        make.bottom.equalTo(_readNumLbl.mas_top).offset(-kWScale(7));
    }];
    
}

#pragma mark - load subviews
- (UIImageView *)showImgv {
    if (!_showImgv) {
        _showImgv = [[UIImageView alloc] init];
        _showImgv.backgroundColor = kLYQBlue;
    }
    return _showImgv;
}

- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.font = kWFont(16);
        _titleLbl.textColor = kLYQBlack;
        _titleLbl.text = @"北欧印象国际旅行社";
    }
    return _titleLbl;
}

- (UILabel *)tagLbl {
    if (!_tagLbl) {
        _tagLbl = [[UILabel alloc] init];
        _tagLbl.font = kWFont(14);
        _tagLbl.textColor = kLYQGray;
        _tagLbl.text = @"北欧5国    ADS邀请函   租车";
    }
    return _tagLbl;
}

- (UILabel *)readNumLbl {
    if (!_readNumLbl) {
        _readNumLbl = [[UILabel alloc] init];
        _readNumLbl.font = kWFont(14);
        _readNumLbl.textColor = kLYQGray;
        _readNumLbl.text = @"阅读 100";
    }
    return _readNumLbl;
}

- (UILabel *)typeLbl {
    if (!_typeLbl) {
        _typeLbl = [[UILabel alloc] init];
        _typeLbl.font = kWFont(14);
        _typeLbl.textColor = kLYQBlue;
        _typeLbl.text = @"地接社  批发商  景点景区";
    }
    return _typeLbl;
}










@end
